home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8312 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: druid.borland.com!usenet
  2. From: pete@borland.com (Pete Becker)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Pure Virtual Destructor Question
  5. Date: 16 Feb 1996 19:22:49 GMT
  6. Organization: Borland International
  7. Distribution: world
  8. Message-ID: <4g2li9$f81@druid.borland.com>
  9. References: <4fecq0$k4e@news4.digex.net> <4fg2s5$r02@cnn.exu.ericsson.se> <4fgp0o$759@news4.digex.net> <4fha1v$89v@news4.digex.net>
  10. NNTP-Posting-Host: pbecker.borland.com
  11. Mime-Version: 1.0
  12. Content-Type: Text/Plain; charset=ISO-8859-1
  13. X-Newsreader: WinVN 0.99.5
  14.  
  15. In article <4fha1v$89v@news4.digex.net>, ell@access1.digex.net says...
  16. >
  17. >Ell (ell@access1.digex.net) wrote:
  18. >: Mickey Williams 66753 (ebumow@ebu.ericsson.com) wrote:
  19. >: : In article k4e@news4.digex.net,  ell@access4.digex.net (Ell) writes:
  20. >: : 
  21. >: : >Immediately above you are logically "defining" your "pure virtual" 
  22. >: : >destructor "inside the class where it is "declared" as a pure virtual
  23. >: : >function.  It is _illegal_ to logically, or physically "define" a pure
  24. >: : >virtual function in the class it is "declared" in.  A pure virtual 
  25. should
  26. >: : >only be defined in classes derived from the class where the pure virtual
  27. >: : >is declared.  Only derived classes should "do some destructor stuff".
  28. >:  
  29. >: : This is not true in the case of pure virtual destructors. You must
  30. >: : always provide a function body for a virtual dtor, even if it
  31. >: : is pure.
  32. >: 
  33. >: Another non-orthogonal, non-intuitive C++ ism.  Oh well.
  34. >: 
  35. >: Elliott
  36. >
  37. >Don't get me wrong, I like the power, oo virtuality, and flexibility of
  38. >the language, and this makes it beautiful for many circumstances.  But
  39. >some things about it are non-orthogonal, and non-intuitive, though
  40. >probably necessary due to its C roots. 
  41.  
  42. In C++ any pure virtual function that will be called by other code must have a 
  43. function body. Why is this "non-orthogonal" when applied to destructors?
  44.     -- Pete
  45.  
  46.